<extend name="Public/base"/>
<block name="style">
	<style type="text/css">
	#studentbook{
		width: 50%;
		height: 350px;
		position:absolute;
		left:60%;
	}
	#booktables{
		width:50%;
	}
	</style>
</block>
<block name="body">
    <div class="main-title">
        <h2>比赛信息</h2>
<div>【<eq name="contest.isready" value="2">进行中</eq><eq name="contest.isready" value="1">未开始</eq><eq name="contest.isready" value="0">已结束</eq>】</div>
        
    </div>
      <form action="{:U()}" method="post" class="form-horizontal">
        <div class="form-item">
            <label class="item-label">比赛名称：{$contest.book_game_name}</label>
		    <label class="item-label">学生姓名：{$student.username}</label>
		    <label class="item-label">学生学号：{$student.sno|substr=4}</label>
		    <label class="item-label">本次积分：<eq name="readtimes.integral" value="">0<else/>{$readtimes.integral}</eq></label>
		    <div id="studentbook"></div>
		    <div class="data-table table-striped">
		    
	<table id="booktables">
    <thead>
        <tr>
		<th class="">序号</th>
		<th class="">图书名称</th>
		<th class="">阅读状态</th>
		</tr>
    </thead>
    <tbody>
		<notempty name="_list">
		<volist name="_list" id="vo">
		<tr>
			<td>{$key+1} </td>
			<td><a href="{:U('Contest/getBookDetail?bookid='.$vo['bookid'])}" class="authorize">{$vo.bookname}</a></td>
			<!-- <td><if condition="$vo.start_time eq null">未读<elseif condition="$vo.end_time eq null" />在读<else/>未读</if></td> -->
			<td><if condition="$vo.isready eq 0">已读<elseif condition="$vo.isready eq 2" />在读<else/>未读</if></td>
		</tr>
		</volist>
		<else/>
		<td colspan="3" class="text-center"> aOh! 暂时还没有内容! </td>
		</notempty>
	</tbody>
    </table>
	</div>
        </div>
        <div class="form-item">
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>
</block>

<block name="script">
	<script type="text/javascript" src="__STATIC__/echarts.min.js"></script>
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('Contest/index')}');
        
        $(function(){
			// 基于准备好的dom，初始化echarts实例
        var bookChart  = echarts.init(document.getElementById('studentbook'));
        // 指定图表的配置项和数据
        var option = {
        	title:{
        		text: "{$student.username}图书状态饼状图",
        		x:'center'
        	},
        	tooltip: {
		        trigger: 'item',
		        formatter: "{a} <br/>{b} : {c} 本 ({d}%)"
		    },
        	legend: {
		        orient: 'vertical',
		        left: 'left',
		        data: [<foreach name="readtimes" item="vo" ><if condition="$vo.isready eq 0">'已读',<elseif condition="$vo.isready eq 2" />'在读',<else/>'未读',</if></foreach>]
		    },
            series : [
		        {
		            name: '图书状态',
		            type: 'pie',
		            radius: '55%',
		            
		            data:[<foreach name="readtimes" item="vo" >
			            {value:'{$vo.cnt}',name:<if condition="$vo.isready eq 0">'已读'<elseif condition="$vo.isready eq 2" />'在读'<else/>'未读'</if>},</foreach>
			        ],
		            itemStyle: {
		                emphasis: {
		                    shadowBlur: 10,
		                    shadowOffsetX: 0,
		                    shadowColor: 'rgba(0, 0, 0, 0.5)'
		                }
            }
		        }
		    ]
        };

        // 使用刚指定的配置项和数据显示图表。
        bookChart.setOption(option);
		})
</script>
</block>
